package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 缺陷记录表
 * @TableName defect_record
 */
@TableName(value ="defect_record")
@Data
public class DefectRecord implements Serializable {
    /**
     * 缺陷记录ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 检测结果ID
     */
    private Long detectionId;

    /**
     * 缺陷代码
     */
    private String defectCode;

    /**
     * 缺陷名称
     */
    private String defectName;

    /**
     * 缺陷分类
     */
    private String defectCategory;

    /**
     * 严重等级(1-5级)
     */
    private Integer severityLevel;

    /**
     * 是否需要维修(0:否,1:是)
     */
    private Integer repairRequired;

    /**
     * 维修优先级(1:低,2:中,3:高,4:紧急)
     */
    private Integer repairPriority;

    /**
     * 预估维修费用
     */
    private BigDecimal estimatedCost;

    /**
     * 维修建议
     */
    private String repairSuggestion;

    /**
     * 状态(PENDING:待处理,REPAIRING:维修中,REPAIRED:已维修,IGNORED:忽略)
     */
    private String status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DefectRecord other = (DefectRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDetectionId() == null ? other.getDetectionId() == null : this.getDetectionId().equals(other.getDetectionId()))
            && (this.getDefectCode() == null ? other.getDefectCode() == null : this.getDefectCode().equals(other.getDefectCode()))
            && (this.getDefectName() == null ? other.getDefectName() == null : this.getDefectName().equals(other.getDefectName()))
            && (this.getDefectCategory() == null ? other.getDefectCategory() == null : this.getDefectCategory().equals(other.getDefectCategory()))
            && (this.getSeverityLevel() == null ? other.getSeverityLevel() == null : this.getSeverityLevel().equals(other.getSeverityLevel()))
            && (this.getRepairRequired() == null ? other.getRepairRequired() == null : this.getRepairRequired().equals(other.getRepairRequired()))
            && (this.getRepairPriority() == null ? other.getRepairPriority() == null : this.getRepairPriority().equals(other.getRepairPriority()))
            && (this.getEstimatedCost() == null ? other.getEstimatedCost() == null : this.getEstimatedCost().equals(other.getEstimatedCost()))
            && (this.getRepairSuggestion() == null ? other.getRepairSuggestion() == null : this.getRepairSuggestion().equals(other.getRepairSuggestion()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDetectionId() == null) ? 0 : getDetectionId().hashCode());
        result = prime * result + ((getDefectCode() == null) ? 0 : getDefectCode().hashCode());
        result = prime * result + ((getDefectName() == null) ? 0 : getDefectName().hashCode());
        result = prime * result + ((getDefectCategory() == null) ? 0 : getDefectCategory().hashCode());
        result = prime * result + ((getSeverityLevel() == null) ? 0 : getSeverityLevel().hashCode());
        result = prime * result + ((getRepairRequired() == null) ? 0 : getRepairRequired().hashCode());
        result = prime * result + ((getRepairPriority() == null) ? 0 : getRepairPriority().hashCode());
        result = prime * result + ((getEstimatedCost() == null) ? 0 : getEstimatedCost().hashCode());
        result = prime * result + ((getRepairSuggestion() == null) ? 0 : getRepairSuggestion().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", detectionId=").append(detectionId);
        sb.append(", defectCode=").append(defectCode);
        sb.append(", defectName=").append(defectName);
        sb.append(", defectCategory=").append(defectCategory);
        sb.append(", severityLevel=").append(severityLevel);
        sb.append(", repairRequired=").append(repairRequired);
        sb.append(", repairPriority=").append(repairPriority);
        sb.append(", estimatedCost=").append(estimatedCost);
        sb.append(", repairSuggestion=").append(repairSuggestion);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}